package com.education.teach.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.education.teach.R;
import com.education.teach.mvp.model.bean.WrongBean;
import com.zzhoujay.richtext.RichText;

import java.util.List;


public class WrongCapAdapter extends BaseQuickAdapter<WrongBean.ResultBean.QueryListBean, BaseViewHolder> {

    Context mContext;

    public WrongCapAdapter(int layoutResId, @Nullable List<WrongBean.ResultBean.QueryListBean> data, Context context) {
        super(layoutResId, data);
        this.mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, WrongBean.ResultBean.QueryListBean item) {
//        String htmlTtile = "<p><img src=\"http://36.48.167.135:8084/study/ueditor1_3_6/jsp/upload/image/20180913/1536802367916025370.png\" title=\"1536802388695028246.png\" alt=\"image.png\"/></p>";
        //https://github.com/zzhoujay/RichText    wiki 地址
        TextView view = (TextView) helper.getView(R.id.richText);
        helper.addOnClickListener(R.id.richText);
        RichText.fromHtml(item.getTitle())
                .into(view);

    }

}
